<?php

// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

// Route::get('/', function () {
//     return 'hello,ThinkPHP5!';
// });
// 首页
Route::get('/', 'index/index/index');
// 用户管理
Route::group('user', function () {
    // 登陆
    Route::get('index', 'index/login/index');
    // 注册
    Route::get('register', 'index/login/register');
    // 退出
    Route::get('logout', 'index/login/logout');
});
// 个人中心
Route::group('account', function () {
    Route::get('/', 'index/account/index');
});
// 讲师管理
Route::group('course', function () {
    // 添加课程页面
    Route::get('add', 'index/course/add');
    // 课程页面
    Route::get('/', 'index/course/index');
    Route::get('index', 'index/course/index');

    // 课程列表
    Route::get('List', 'index/course/List');

    // 添加课程方法
    Route::post('add', 'index/course/addFunc');
    // 编辑课程页面
    Route::get('edit/:id', 'index/course/editCourse');
    // 编辑课程方法
    Route::post('edit/:id', 'index/course/editCourseFunc');
    // 上下架课程方法
    Route::put('edit/:id', 'index/course/putCourseFunc');

    // 添加章节页面
    Route::get('chapter/:id', 'index/course/chapter');
    // 章节列表
    Route::get('chapterList/:id', 'index/course/chapterList');
    // 添加章节
    Route::post('chapter/:id', 'index/course/addChapter');
    // 编辑章节
    Route::put('chapter/:id', 'index/course/editChapter');
    // 删除章节
    Route::delete('chapter/:id', 'index/course/delChapter');

    // 添加课时页面
    Route::get('period/:id', 'index/course/period');
    // 课时列表
    Route::get('periodList/:id', 'index/course/periodList');
    // 添加课时
    Route::post('period/:id', 'index/course/addPeriod');
    // 编辑课时
    Route::put('period/:id', 'index/course/editPeriod');
    // 删除课时
    Route::delete('period/:id', 'index/course/delPeriod');
});

// 文件上传
Route::group('upload', function () {
    // 课程介绍图片上传
    Route::post('course', 'index/upload/course');
    // 课程封面图片上传
    Route::post('cover', 'index/upload/cover');
    // 课件上传
    Route::post('courseware','index/upload/courseware');
});
// 七牛云
Route::group('qiniu', function () {
    // 视频上传
    Route::post('video', 'index/qiniu/video');
});
